
#include <QApplication>
#include <QQmlApplicationEngine>
#include "qgis.h"
#include "qgsmapview.h"

#include <QCoreApplication>
#include <QProcessEnvironment>
#include <QQuickWindow>
#include <qgsproviderregistry.h>
#include <qgsrasterlayer.h>
#include <qgsvectorlayer.h>

int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
    QApplication app(argc, argv);
    QProcessEnvironment env = QProcessEnvironment::systemEnvironment();


    //qmlRegisterType<QgsMapView>("com.example.qgis", 1, 0, "QgsMapView");

    // QQmlApplicationEngine engine;
    // const QUrl url(QStringLiteral("qrc:/main.qml"));
    // QObject::connect(
    //     &engine,
    //     &QQmlApplicationEngine::objectCreated,
    //     &app,
    //     [url](QObject *obj, const QUrl &objUrl) {
    //         if (!obj && url == objUrl)
    //             QCoreApplication::exit(-1);
    //     },
    //     Qt::QueuedConnection);
    // engine.load(url);

    MapWidget *mapWidget = new MapWidget();
    mapWidget->show();

    return app.exec();
}
